package com.lmf.config;


import com.lmf.entity.Jwt;
import com.lmf.service.AuthServiceHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "auth",fallback = AuthServiceHystrix.class)
public interface AuthServiceClient {
    @PostMapping(value = "/oauth/token")
    Jwt getToken(@RequestHeader(value="Authorization")String authorization,
                 @RequestParam("grant_type")String type,
                 @RequestParam("username")String username,
                 @RequestParam("password")String password);

}
